package com.liang.jiekou.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liang.jiekou.entity.Result;
import com.liang.jiekou.entity.result.COPTCD;
import com.liang.jiekou.entity.result.MOCTAB;
import com.liang.jiekou.entity.result.PURTCD;
import com.liang.jiekou.service.MOCTAService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "工单控制器")
@RestController
public class MOCTAController {
    @Resource
    private MOCTAService moctaService;


    @ApiOperation("根据单别单号查询工单信息")
    //查询工单信息
    @GetMapping("/selectMOCTAB")
    public MOCTAB selectMOCTAMOCB(@RequestParam("TA001") String db,@RequestParam("TA002") String dh){
        return moctaService.selectMOCTAMOCTB(db, dh);
    }


    /*@ApiOperation("查询全部工单的信息")
    @GetMapping("/selectMOCTAB/all")
    public Result<IPage<MOCTAB>> selectINVMBall(@RequestParam Integer page, @RequestParam Integer pageSize,
                                                String startcreate, String endcreate, String startupdate, String endupdate
    ){
        Page<MOCTAB> paging = new Page<>(page, pageSize);

        IPage<MOCTAB> moctabiPage = moctaService.selectMOCTABall(paging,startcreate,endcreate,startupdate,endupdate);

        return Result.success(moctabiPage);

    }*/

    @ApiOperation("查询全部工单的信息")
    @GetMapping("/selectMOCTAB/all")
    public Result<Page<MOCTAB>> selectINVMBall(@RequestParam Integer page, @RequestParam Integer pageSize,
                                                String startcreate, String endcreate, String startupdate, String endupdate
    ){
        Page<MOCTAB> moctabPage = moctaService.selectMoctabPage(page, pageSize,startcreate,endcreate,startupdate,endupdate);
        return Result.success(moctabPage);

    }

}
